package com.ljb.commlibrary.oss.v20;

import com.alibaba.sdk.android.oss.internal.OSSAsyncTask;

/**
 * Created by ljb on 2018/4/28.
 */

public class UploadConfig {
    /**
     * 文件上传成功后的访问地址url
     */
    public String objectURL;
    /**
     * task异步任务, 可以调用task.cancel()取消任务, task.waitUntilFinished()等待直到任务完成
     */
    public OSSAsyncTask task;
    /**
     * 文件名称,如果想在OSS中显示层级结构,可以把objectKey写为"folder/subfolder/file"的格式,注意不能以'/'开头
     */
    public String objectKey;
    /**
     * 文件上传路径
     */
    public String uploadFilePath;

    /**
     * 参数标记,主要用于区分不同的参数配置对象
     */
    public Object tag;

    public UploadConfig() {
    }

    public UploadConfig(String objectKey, String uploadFilePath) {
        this.objectKey = objectKey;
        this.uploadFilePath = uploadFilePath;
    }

    @Override
    public String toString() {
        return "UploadConfig{" +
                "objectURL='" + objectURL + '\'' +
                ", objectKey='" + objectKey + '\'' +
                ", uploadFilePath='" + uploadFilePath + '\'' +
                '}';
    }
}
